﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="equipamentos.aspx.cs" Inherits="area_admin_equipamentos"  EnableEventValidation="false"%>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Panel ID="Panel1" runat="server">
        <table style="width: 100%">
            <tr>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtDescricao" ErrorMessage="*" SetFocusOnError="True" 
                        ForeColor="#FF6699" Font-Size="16pt" Font-Names="Vrinda" 
                        ValidationGroup="insercao">*</asp:RequiredFieldValidator>
                    Equipamento:</td>
                <td>
                    <asp:TextBox ID="txtDescricao" runat="server" ValidationGroup="insercao"></asp:TextBox>
                </td>
                <td width="100%">
                    <asp:Button ID="btnPesquisar" runat="server" onclick="btnPesquisar_Click" 
                        Text="Buscar" Width="70px" CausesValidation="False" />
                    &nbsp;<asp:Button ID="btnIncluir" runat="server" 
                        Text="Incluir" Width="70px" ValidationGroup="insercao" />
                    <cc1:ModalPopupExtender ID="btnIncluir_ModalPopupExtender" runat="server" 
                        BackgroundCssClass="modalBackground" CancelControlID="btnNao" 
                        DynamicServicePath="" Enabled="True" PopupControlID="pnlConfirm" 
                        TargetControlID="btnIncluir">
                    </cc1:ModalPopupExtender>
                </td>
            </tr>
        </table>
        <asp:GridView ID="grdEquipamentos" runat="server" AutoGenerateColumns="False" 
            DataSourceID="linqEquipamentos" DataKeyNames="idEquipamento" 
            onselectedindexchanged="grdSituacoes_SelectedIndexChanged" 
            EnableTheming="True" Width="380px" EmptyDataText="Nenhum equipamento encontrado." 
            onrowdeleting="grdEquipamentos_RowDeleting" 
            ondatabound="grdEquipamentos_DataBound" 
            onrowediting="grdEquipamentos_RowEditing" AllowPaging="True" SkinID="q" 
            onrowcreated="grdEquipamentos_RowCreated">
            <Columns>
                <asp:TemplateField HeaderText="Lista de Equipamentos" InsertVisible="False" 
                    SortExpression="idSituacao">
                    <EditItemTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td ID="20">
                                    <asp:TextBox ID="TextBox1" runat="server" MaxLength="100" 
                                        Text='<%# Bind("Nome") %>' Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td ID="21" align="center">
                                    <asp:Button ID="btnSalvar" runat="server" CommandName="Update" Text="Salvar" 
                                        Width="100px" TabIndex="1" />
                                    &nbsp;<asp:Button ID="btnSalvar0" runat="server" CommandName="Cancel" 
                                        Text="Cancelar" Width="100px" TabIndex="2" />
                                </td>
                            </tr>
                        </table>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td ID="2">
                                    <asp:Label ID="Label1" runat="server" Font-Bold="True" 
                                        Text='<%# Bind("Nome") %>' CssClass="titulo3"></asp:Label>
                                </td>
                                <td valign="top" width="80px">
                                    <asp:Button ID="Button2" runat="server" CommandName="Edit" 
                                        SkinID="EditarOnTop" ValidationGroup="edicao" />
                                    <asp:Button ID="Button1" runat="server" CommandName="Select" 
                                        SkinID="ExcluirOnTop" />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:LinqDataSource ID="linqEquipamentos" runat="server" 
            ContextTypeName="dbSisInfoDataContext" EnableDelete="True" EnableUpdate="True" 
            OrderBy="Nome" TableName="EQUIPAMENTOs">
        </asp:LinqDataSource>
        <asp:Panel ID="pnlConfirm" runat="server" Height="100px" 
            HorizontalAlign="Center" SkinID="Confirmacao" Width="300px">
            <br />
            <asp:Label ID="Label2" runat="server" Text="Deseja confirmar?"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnSim" runat="server" onclick="btnIncluir_Click" Text="Sim" 
                ValidationGroup="insercao" />
            <asp:Button ID="btnNao" runat="server" Text="Nao" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress2" runat="server">
                <ProgressTemplate>
                    CARREGANDO...
                </ProgressTemplate>
            </asp:UpdateProgress>
        </asp:Panel>
        <asp:Panel ID="pnlConfirmDelete" runat="server" Height="100px" 
            HorizontalAlign="Center" SkinID="Confirmacao" Width="300px">
            <br />
            <asp:Label ID="Label3" runat="server" Text="Deseja confirmar?"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnSim0" runat="server" CausesValidation="False" Text="Sim" 
                onclick="btnSim0_Click" />
            <asp:Button ID="btnNao0" runat="server" CausesValidation="False" Text="Nao" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    CARREGANDO...
                </ProgressTemplate>
            </asp:UpdateProgress>
        </asp:Panel>
        <asp:Label ID="lbDelete" runat="server" Text="."></asp:Label>
        <br />
        <cc1:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" 
            BackgroundCssClass="modalBackground" CancelControlID="btnNao0" 
            DynamicServicePath="" Enabled="True" PopupControlID="pnlConfirmDelete" 
            TargetControlID="lbDelete">
        </cc1:ModalPopupExtender>
    </asp:Panel>
</asp:Content>

